package com.vil.mapper;

import com.vil.entity.Admin;
import com.vil.entity.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface RoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Role record);

    int insertSelective(Role record);

    Role selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);

    //批量删除
    int deleteMany(Long[] array);

    //多条件查询
    List<Role> getListByManyConditions(Role role);

    //判断角色名是否存在
    @Select("select count(1) from role where role_code = #{role_code}")
    int isExist(@Param("role_code")String role_code);
}